package main

/**
stu2 := Student{}

 */
import (
	"fmt"
	"reflect"
)

func main() {

	stu1 := Student{"xiaowang", 22, "address1", 170}
	fmt.Println(stu1)

	stu2 := Student{}
	stu2.addr = "address2.."
	fmt.Println(stu2)

	var stu3 *Student = &Student{}
	//指针和指针所指内存都可以通过 . 和结构体属性交互
	stu3.name = "hi"
	(*stu3).age = 22
	fmt.Println(reflect.TypeOf(stu3))
	fmt.Println(*stu3)
	fmt.Println(stu3)

	//比较赋值
	stu4 := Student{}
	stu4 = stu2
	stu4.age = 23
	//stu4 = *stu3
	fmt.Println(stu2 == stu4)
}

type Student struct {
	name string
	age  int
	addr string
	High int
}
